import type { MenuListResult } from '@/api/model/permissionModel';
import { request } from '@/utils/request';

export function getTenantByWebsite(params: any) {
  return request.get({
    url: '/system/tenant/get-by-website',
    params,
  });
}
export function getTenantIdByName(params: any) {
  return request.get({
    url: '/system/tenant/get-id-by-name',
    params,
  });
}
// 获取所有租户名称和id
export function getTenantList() {
  return request.get({
    url: '/system/tenant/list-all-simple',
  });
}
export function login(data: any) {
  return request.post({
    url: '/system/auth/login',
    data,
  });
}

export function getUserInfo() {
  return request.get({
    url: '/system/auth/get-permission-info',
  });
}

export function refreshToken(data: any) {
  return request.post({
    url: `/system/auth/refresh-token?refreshToken=${data.refreshToken}`,
    data,
  });
}

export function getMenuList() {
  return request.get<MenuListResult>({
    url: '/system/auth/get-permission-info',
  });
}

export function getDictionaryList() {
  return request.get({
    url: '/system/dict-data/simple-list',
  });
}

export function getAllSimpleUserlist() {
  return request.get({
    url: '/system/user/get-all-user',
  });
}
